package com.fxz.oauth.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;

/**
 * @author Fxz
 * @version 1.0
 * @date 2021-08-04 10:07
 */
@With
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Data
@TableName("sys_role")
public class Role implements GrantedAuthority, Serializable,Comparable<Role> {

    @TableId
    private Long id;
    @TableField("role_name")
    private String authority;

    @Override
    public int compareTo(Role o) {
        return o.id>this.id?1:0;
    }
}
